package day17_Inet.demo02_UDP;

import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;

public class Send_UDPcopy {
    public static void main(String[] args) throws Exception {
        DatagramSocket ds = new DatagramSocket();
        String s="hello,UDP";
        byte[] bytes = s.getBytes();
        InetAddress ip = InetAddress.getByName("192.168.3.172");
        DatagramPacket dp = new DatagramPacket(bytes, 0, bytes.length, ip, 8888);
        ds.send(dp);
        ds.close();
    }
}
